<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>test1</title>
</head>
<body>
	<h1>test1</h1>
</body>
<script type="text/javascript">
    
    var baz;

    (function(){
        var foo=2;
        var bar=10;
        baz=function(){
            return foo*bar
        }
    })()

    alert(baz())
</script>
</html>